using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._Raster._Conversion
{
    /// <summary>
    /// <para>Raster To Multipoint</para>
    /// <para>Converts raster cell centers into 3D multipoint features whose Z values reflect the raster cell value.</para>
    /// <para>将栅格像元中心转换为其 Z 值反映栅格像元值的 3D 多点要素。</para>
    /// </summary>    
    [DisplayName("Raster To Multipoint")]
    public class RasterToMultipoint : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RasterToMultipoint()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input Raster</para>
        /// <para>The raster to process.</para>
        /// <para>要处理的栅格。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// </param>
        public RasterToMultipoint(object _in_raster, object _out_feature_class)
        {
            this._in_raster = _in_raster;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Raster To Multipoint";

        public override string CallName => "3d.RasterToMultipoint";

        public override List<string> AcceptEnvironments => ["XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_feature_class, _out_vip_table, _method.GetGPValue(), _kernel_method.GetGPValue(), _z_factor, _thinning_value];

        /// <summary>
        /// <para>Input Raster</para>
        /// <para>The raster to process.</para>
        /// <para>要处理的栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Output VIP table</para>
        /// <para>The histogram table to be produced when VIP Histogram is specified for the Method parameter.</para>
        /// <para>为 Method 参数指定 VIP 直方图时要生成的直方图表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output VIP table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_vip_table { get; set; } = null;


        /// <summary>
        /// <para>Thinning Method</para>
        /// <para><xdoc>
        ///   <para>The thinning method applied to the input raster to select a subset of cells that will be exported to the multipoint feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>No Thinning—No thinning will be applied. This is the default.</bullet_item><para/>
        ///     <bullet_item>Z Tolerance—Only exports the cells that are required for maintaining a surface within a specified Z-range of the input raster.</bullet_item><para/>
        ///     <bullet_item>Kernel—Divides the raster into equal sized tiles based on the specified thinning value, then selects one or two cells which meet the criteria defined by the designated kernel method.</bullet_item><para/>
        ///     <bullet_item>VIP—Employs a roving 3 cell by 3 cell window that is used to create a 3-dimensional best fit plane. Each cell is given a significance score based on its absolute deviation from this plane. A histogram of these scores is then used to determine the cells that get exported based on the percentile designated in the Thinning Value parameter.</bullet_item><para/>
        ///     <bullet_item>VIP Histogram—Creates a table to view the actual significance values and the corresponding number of points associated with those values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>应用于输入栅格的细化方法，用于选择将导出到多点要素类的像元子集。</para>
        ///   <bulletList>
        ///     <bullet_item>不变薄 （No Thining） - 不应用变薄。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>Z 容差 - 仅导出将表面保持在输入栅格的指定 Z 范围内所需的像元。</bullet_item><para/>
        ///     <bullet_item>核 - 根据指定的细化值将栅格划分为大小相等的切片，然后选择一个或两个符合指定核方法定义条件的像元。</bullet_item><para/>
        ///     <bullet_item>VIP - 使用流动的 3 像元 x 3 像元窗口，用于创建 3 维最佳拟合平面。每个单元格都根据其与该平面的绝对偏差给出一个显著性分数。然后，这些分数的直方图用于根据“稀释值”参数中指定的百分位数确定导出的像元。</bullet_item><para/>
        ///     <bullet_item>VIP 直方图 （VIP Histogram） - 创建一个表以查看实际显著性值以及与这些值关联的相应点数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Thinning Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._NO_THIN;

        public enum _method_value
        {
            /// <summary>
            /// <para>Z Tolerance</para>
            /// <para>Z Tolerance—Only exports the cells that are required for maintaining a surface within a specified Z-range of the input raster.</para>
            /// <para>Z 容差 - 仅导出将表面保持在输入栅格的指定 Z 范围内所需的像元。</para>
            /// </summary>
            [Description("Z Tolerance")]
            [GPEnumValue("ZTOLERANCE")]
            _ZTOLERANCE,

            /// <summary>
            /// <para>Kernel</para>
            /// <para>Kernel—Divides the raster into equal sized tiles based on the specified thinning value, then selects one or two cells which meet the criteria defined by the designated kernel method.</para>
            /// <para>核 - 根据指定的细化值将栅格划分为大小相等的切片，然后选择一个或两个符合指定核方法定义条件的像元。</para>
            /// </summary>
            [Description("Kernel")]
            [GPEnumValue("KERNEL")]
            _KERNEL,

            /// <summary>
            /// <para>VIP Histogram</para>
            /// <para>VIP Histogram—Creates a table to view the actual significance values and the corresponding number of points associated with those values.</para>
            /// <para>VIP 直方图 （VIP Histogram） - 创建一个表以查看实际显著性值以及与这些值关联的相应点数。</para>
            /// </summary>
            [Description("VIP Histogram")]
            [GPEnumValue("VIP_HISTOGRAM")]
            _VIP_HISTOGRAM,

            /// <summary>
            /// <para>VIP</para>
            /// <para>VIP—Employs a roving 3 cell by 3 cell window that is used to create a 3-dimensional best fit plane. Each cell is given a significance score based on its absolute deviation from this plane. A histogram of these scores is then used to determine the cells that get exported based on the percentile designated in the Thinning Value parameter.</para>
            /// <para>VIP - 使用流动的 3 像元 x 3 像元窗口，用于创建 3 维最佳拟合平面。每个单元格都根据其与该平面的绝对偏差给出一个显著性分数。然后，这些分数的直方图用于根据“稀释值”参数中指定的百分位数确定导出的像元。</para>
            /// </summary>
            [Description("VIP")]
            [GPEnumValue("VIP")]
            _VIP,

            /// <summary>
            /// <para>No Thinning</para>
            /// <para>No Thinning—No thinning will be applied. This is the default.</para>
            /// <para>不变薄 （No Thining） - 不应用变薄。这是默认设置。</para>
            /// </summary>
            [Description("No Thinning")]
            [GPEnumValue("NO_THIN")]
            _NO_THIN,

        }

        /// <summary>
        /// <para>Kernel Method</para>
        /// <para><xdoc>
        ///   <para>The selection method used within each kernel neighborhood when kernel thinning is applied on the input raster.</para>
        ///   <bulletList>
        ///     <bullet_item>Minimum—A point is created at the cell with the smallest elevation value found in the kernel neighborhood. This is the default.</bullet_item><para/>
        ///     <bullet_item>Maximum—A point is created at the cell with the largest elevation value found in the kernel neighborhood.</bullet_item><para/>
        ///     <bullet_item>Minimum and Maximum—Two points are created at the cells with the smallest and largest Z values found in the kernel neighborhood.</bullet_item><para/>
        ///     <bullet_item>Closest to Mean—A point is created at the cell whose elevation value is closest to the average of the cells in the kernel neighborhood.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在输入栅格上应用核细化时，每个核邻域内使用的选择方法。</para>
        ///   <bulletList>
        ///     <bullet_item>最小值 - 在核邻域中找到的最小高程值的像元处创建一个点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最大值 - 在核邻域中找到的最大高程值的像元处创建一个点。</bullet_item><para/>
        ///     <bullet_item>最小值和最大值 - 在核邻域中找到的最小和最大 Z 值的像元处创建两个点。</bullet_item><para/>
        ///     <bullet_item>最接近平均值 - 在高程值最接近核邻域中像元平均值的像元处创建一个点。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Kernel Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _kernel_method_value _kernel_method { get; set; } = _kernel_method_value._MIN;

        public enum _kernel_method_value
        {
            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—A point is created at the cell with the smallest elevation value found in the kernel neighborhood. This is the default.</para>
            /// <para>最小值 - 在核邻域中找到的最小高程值的像元处创建一个点。这是默认设置。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MIN")]
            _MIN,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—A point is created at the cell with the largest elevation value found in the kernel neighborhood.</para>
            /// <para>最大值 - 在核邻域中找到的最大高程值的像元处创建一个点。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAX")]
            _MAX,

            /// <summary>
            /// <para>Minimum and Maximum</para>
            /// <para>Minimum and Maximum—Two points are created at the cells with the smallest and largest Z values found in the kernel neighborhood.</para>
            /// <para>最小值和最大值 - 在核邻域中找到的最小和最大 Z 值的像元处创建两个点。</para>
            /// </summary>
            [Description("Minimum and Maximum")]
            [GPEnumValue("MINMAX")]
            _MINMAX,

            /// <summary>
            /// <para>Closest to Mean</para>
            /// <para>Closest to Mean—A point is created at the cell whose elevation value is closest to the average of the cells in the kernel neighborhood.</para>
            /// <para>最接近平均值 - 在高程值最接近核邻域中像元平均值的像元处创建一个点。</para>
            /// </summary>
            [Description("Closest to Mean")]
            [GPEnumValue("MEAN")]
            _MEAN,

        }

        /// <summary>
        /// <para>Z Factor</para>
        /// <para>The factor by which z-values will be multiplied. This is typically used to convert z linear units to match x,y linear units. The default is 1, which leaves elevation values unchanged. This parameter is not available if the spatial reference of the input surface has a z datum with a specified linear unit.</para>
        /// <para>z 值将乘以的因子。这通常用于转换 z 线性单位以匹配 x，y 线性单位。默认值为 1，使高程值保持不变。如果输入曲面的空间参考具有具有指定线性单位的 z 基准面，则此参数不可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _z_factor { get; set; } = 1;


        /// <summary>
        /// <para>Thinning Value</para>
        /// <para><xdoc>
        ///   <para>The meaning of this value will depend on the specified Thinning Method.</para>
        ///   <bulletList>
        ///     <bullet_item>Z Tolerance—The maximum allowable difference in z units between the input raster and the surface created from the output multipoint feature class. When selecting this method, the thinning value defaults to one tenth of the z range of the input raster.</bullet_item><para/>
        ///     <bullet_item>Kernel—The number of raster cells along the edge of each tile. This value defaults to 3, which means the raster would be divided into 3 cell by 3 cell windows.</bullet_item><para/>
        ///     <bullet_item>VIP—The percentile rank of the histogram of significance scores. This value defaults to 5.0, which means the cells whose score was within the top 5% of the histogram will be exported.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此值的含义将取决于指定的“变薄方法”。</para>
        ///   <bulletList>
        ///     <bullet_item>Z 容差 - 输入栅格与根据输出多点要素类创建的表面之间允许的最大差值（以 z 为单位）。选择此方法时，细化值默认为输入栅格 z 范围的十分之一。</bullet_item><para/>
        ///     <bullet_item>内核 - 沿每个切片边缘的栅格像元数。此值默认为 3，这意味着栅格将除以 3 个像元窗口划分为 3 个像元。</bullet_item><para/>
        ///     <bullet_item>VIP - 显著性分数直方图的百分位排名。此值默认为 5.0，这意味着将导出分数在直方图前 5% 以内的单元格。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Thinning Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _thinning_value { get; set; } = 1;


        public RasterToMultipoint SetEnv(object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}